using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Sysgeprava.Entities;

namespace Sysgeprava.Repository.Mapping
{
    public class FOTO_FINCAMap : EntityTypeConfiguration<FOTO_FINCA>
    {
        public FOTO_FINCAMap()
        {
            // Primary Key
            this.HasKey(t => t.IdFinca);

            // Properties
            this.Property(t => t.IdFinca)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("FOTO_FINCA");
            this.Property(t => t.IdFinca).HasColumnName("IdFinca");
            this.Property(t => t.Imagen).HasColumnName("Imagen");
            this.Property(t => t.Hash).HasColumnName("Hash");

            // Relationships
            this.HasRequired(t => t.FINCA)
                .WithOptional(t => t.FOTO_FINCA);

        }
    }
}
